Skip to content

HDDS-15100. Add an OM config to toggle Ozone snapshot rename feature#10156

Merged
smengcl merged 2 commits intoapache:masterfrom
smengcl:HDDS-15100-ss-rename-toggle
Apr 30, 2026
Merged

HDDS-15100. Add an OM config to toggle Ozone snapshot rename feature#10156
smengcl merged 2 commits intoapache:masterfrom
smengcl:HDDS-15100-ss-rename-toggle

Conversation

@smengcl
Copy link
Copy Markdown
Contributor

@smengcl smengcl commented Apr 28, 2026

What changes were proposed in this pull request?

So far Ozone snapshot rename feature is buggy (see HDDS-11384) and we would like to have a config to disable this feature on Ozone Manager so it wouldn't be misused. AFAIK snapshot rename requires snapshot to fully transition to id-based to be truly safe to do.

For now, we should at least put it behind a config and disable that by default.

Demo

Disabled by default (tested in dev docker compose cluster):

$ ozone sh snapshot rename s3v/buck1 ss1 ss12
FEATURE_NOT_ENABLED Ozone snapshot rename feature is not allowed per Ozone Manager server config

Enabled by setting on OM, restart:

$ ozone sh bucket create s3v/buck1
$ ozone sh snapshot create s3v/buck1 ss1
$ ozone sh snapshot rename s3v/buck1 ss1 ss12
$ ozone sh snapshot list s3v/buck1
[ {
  "volumeName" : "s3v",
  "bucketName" : "buck1",
  "name" : "ss12",
...

What is the link to the Apache JIRA

https://issues.apache.org/jira/browse/HDDS-15100

How was this patch tested?

  • Snapshot rename request unit test is added
  • CLI integration test case is added

@smengcl smengcl added the snapshot https://issues.apache.org/jira/browse/HDDS-6517 label Apr 28, 2026
Copy link
Copy Markdown
Contributor

@priyeshkaratha priyeshkaratha left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @smengcl for the patch. Changes overall LGTM. There is an issue with testcase, please check the inline comment.

@jojochuang jojochuang requested a review from sadanand48 April 29, 2026 19:20
Copy link
Copy Markdown
Contributor

@jojochuang jojochuang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm except Priyesh's comments.

@smengcl smengcl marked this pull request as ready for review April 30, 2026 01:45
Copilot AI review requested due to automatic review settings April 30, 2026 01:45
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds an OM-side configuration flag to gate the snapshot rename operation (disabled by default) to prevent use of a known-buggy feature until it’s safe, and updates tests/docs accordingly.

Changes:

  • Introduce ozone.om.snapshot.rename.allowed (default: false) and document it in defaults + snapshot docs.
  • Enforce the gate in OMSnapshotRenameRequest.preExecute() by rejecting rename requests with FEATURE_NOT_ENABLED.
  • Update/extend unit + integration tests to explicitly enable rename where needed and to validate the blocked-by-default behavior.

Reviewed changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/request/snapshot/OMSnapshotRenameRequest.java Enforces OM config gate for snapshot rename in preExecute.
hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/om/OMConfigKeys.java Adds config key + default constant for snapshot rename gate.
hadoop-hdds/common/src/main/resources/ozone-default.xml Registers the new config in default properties (default false).
hadoop-hdds/docs/content/feature/Snapshot.md Documents requirement to enable rename via config.
hadoop-hdds/docs/content/feature/Snapshot-Configuration-Properties.md Lists the new config in snapshot-related properties.
hadoop-ozone/ozone-manager/src/test/java/org/apache/hadoop/ozone/om/request/snapshot/TestOMSnapshotRenameRequest.java Sets rename allowed for existing tests; adds unit test for blocked behavior.
hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/fs/ozone/TestOzoneFsSnapshot.java Adds integration coverage that rename is blocked when config disallows (API + CLI).
hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/snapshot/TestOzoneManagerSnapshotAcl.java Enables rename in this IT to keep rename-related coverage working under new default.
hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestOmMetrics.java Enables rename in metrics IT to keep rename-related operations working under new default.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@smengcl smengcl merged commit 39aeb20 into apache:master Apr 30, 2026
66 checks passed
@smengcl smengcl deleted the HDDS-15100-ss-rename-toggle branch April 30, 2026 07:17
@smengcl
Copy link
Copy Markdown
Contributor Author

smengcl commented Apr 30, 2026

Merged. Thanks @priyeshkaratha and @jojochuang for the swift reviews.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

snapshot https://issues.apache.org/jira/browse/HDDS-6517

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants